<?php
/**
 # com_jvframework - JV Framework
 # @version		1.5.x
 # ------------------------------------------------------------------------
 # author    Open Source Code Solutions Co
 # copyright Copyright (C) 2011 joomlavi.com. All Rights Reserved.
 # @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL or later.
 # Websites: http://www.joomlavi.com
 # Technical Support:  http://www.joomlavi.com/my-tickets.html
-------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

class JVUsertool {
    public function getUsertool(){ 
        $options= JVFactory::getParameter();
        $layouts= JVFactory::getJVLayout(); 
        $hook   = JVHooks::getInstance();
        $hook->addStyleSheet($layouts->getBaseThemesUrl().'/css/usertool.css');
        $theme  = 'jvtheme'.JVFactory::getFramework()->getActiveTheme()->id;
        $params = new JVParameter(json_encode(array(
            'layouttype'    => $options->getLayoutType(),
            'direction'     => $options->getDirection(),
            'menustyle'     => $options->getMenuStyle(),
            'templatecolor' => $options->getTemplateColor()
        )), JVPATH_LIBRARIES .'libraries/addons/usertools/usertools.xml');
             
        $tool   = '
        <div id="userpanels">
            
                	<form id="userpanel" action="index.php">
                    	<div class="us_rows layouttype clearfix">
                            <label class="us_label" >Layout setting</label>
                                    '.$params->render($theme, 'LAYOUT').'
                        </div>
                        <div class="us_rows direction clearfix">
                        	<label class="us_label" >Direction</label>
                             '.$params->render($theme, 'DIRECTION').'
                        </div>
                        <div class="us_rows menu_style clearfix">
                                <label class="us_label">Menu Style</label>                               
                                '.$params->render($theme, 'MENU').' 
                        </div>
                        <div class="us_rows temp_color clearfix">
                                    <label class="us_label">Theme Colors</label>
                                    '.$params->render($theme, 'THEME').'
                        </div>
                        <div class="bt-bottom">
                        	<input type="hidden" name="theme" value="'.$theme.'"/> 
                            <input type="submit" onclick="return false;" value="Apply" class="bt-panels"/> 
                            <input type="reset" onclick="return false;" value="Reset" class="bt-panels"/>
                        </div>
                    </form>                
                 <a href="javascript:void(0)" id="toggle"> </a>
                
        </div>
        
        ';
        
        return $tool;
    }
}
